# 管理模块新增:/api/sys/user
# 管理模块修改:/api/sys/user/:target
# 管理模块查询:/api/sys/user/:target
# 管理模块删除:/api/sys/user/:target
import requests
from config import URL


class EmpApi(object):
    def __init__(self):
        self.emp_url = URL + "/api/sys/user"

    def add_emp(self, body, headers):
        return requests.post(self.emp_url, json=body, headers=headers)

    def query_emp(self, emp_id, headers):
        return requests.get(self.emp_url + '/' + emp_id, headers=headers)

    def modify_emp(self, emp_id, body, headers):
        return requests.put(self.emp_url + '/' + emp_id, json=body, headers=headers)

    def delete_emp(self, emp_id, headers):
        return requests.delete(self.emp_url + '/' + emp_id, headers=headers)
